<?php

/**
 * AbetInsCourse filter form base class.
 *
 * @package    sfproject
 * @subpackage filter
 * @author     Your name here
 */
abstract class BaseAbetInsCourseFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'abet_instructor_id'    => new sfWidgetFormPropelChoice(array('model' => 'AbetInstructor', 'add_empty' => true)),
      'stu_t'                 => new sfWidgetFormFilterInput(),
      'ins_theory_sec_num'    => new sfWidgetFormFilterInput(),
      'ins_practical_sec_num' => new sfWidgetFormFilterInput(),
      'created_at'            => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'updated_at'            => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
    ));

    $this->setValidators(array(
      'abet_instructor_id'    => new sfValidatorPropelChoice(array('required' => false, 'model' => 'AbetInstructor', 'column' => 'id')),
      'stu_t'                 => new sfValidatorPass(array('required' => false)),
      'ins_theory_sec_num'    => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'ins_practical_sec_num' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'created_at'            => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'updated_at'            => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
    ));

    $this->widgetSchema->setNameFormat('abet_ins_course_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'AbetInsCourse';
  }

  public function getFields()
  {
    return array(
      'id'                    => 'Number',
      'cou_num'               => 'ForeignKey',
      'abet_instructor_id'    => 'ForeignKey',
      'stu_t'                 => 'Text',
      'ins_theory_sec_num'    => 'Number',
      'ins_practical_sec_num' => 'Number',
      'created_at'            => 'Date',
      'updated_at'            => 'Date',
    );
  }
}
